package com.sls.nzdapplication.model;


import com.alibaba.fastjson.JSONObject;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

import java.util.Date;

@Entity
public class Meter {

    @Id
    private String id;

    private String meterCode;

    private int code;

    private int rowNum;

    private int columnNum;

    private String username;

    private boolean match;

    private String boxId;

    private Date createTime;

    private String createBy;

    private Date modifyTime;

    private String modifyBy;

    private String userCode;

    public JSONObject toJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",this.id);
        jsonObject.put("meterCode",this.meterCode);
        jsonObject.put("code",this.code);
        jsonObject.put("rowNum",this.rowNum);
        jsonObject.put("columnNum",this.columnNum);
        jsonObject.put("username",this.username);
        jsonObject.put("match",this.match);
        jsonObject.put("boxId",this.boxId);
        jsonObject.put("createTime",this.createTime);
        jsonObject.put("createBy",this.createBy);
        jsonObject.put("modifyTime",this.modifyTime);
        jsonObject.put("modifyBy",this.modifyBy);
        jsonObject.put("userCode",this.userCode);
        return jsonObject;
    }

    public Meter(JSONObject jsonObject){
        this.id = jsonObject.getString("id");
        this.meterCode = jsonObject.getString("meterCode");
        this.code = jsonObject.getIntValue("code");
        this.rowNum = jsonObject.getIntValue("rowNum");
        this.columnNum = jsonObject.getIntValue("columnNum");
        this.username = jsonObject.getString("username");
        this.match = jsonObject.getBoolean("match");
        this.boxId = jsonObject.getString("boxId");
        this.createTime = jsonObject.getDate("createTime");
        this.createBy = jsonObject.getString("createBy");
        this.modifyTime = jsonObject.getDate("modifyTime");
        this.modifyBy = jsonObject.getString("modifyBy");
        this.userCode = jsonObject.getString("userCode");
    }

    @Generated(hash = 250057661)
    public Meter(String id, String meterCode, int code, int rowNum, int columnNum,
            String username, boolean match, String boxId, Date createTime,
            String createBy, Date modifyTime, String modifyBy, String userCode) {
        this.id = id;
        this.meterCode = meterCode;
        this.code = code;
        this.rowNum = rowNum;
        this.columnNum = columnNum;
        this.username = username;
        this.match = match;
        this.boxId = boxId;
        this.createTime = createTime;
        this.createBy = createBy;
        this.modifyTime = modifyTime;
        this.modifyBy = modifyBy;
        this.userCode = userCode;
    }

    @Generated(hash = 936842546)
    public Meter() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMeterCode() {
        return this.meterCode;
    }

    public void setMeterCode(String meterCode) {
        this.meterCode = meterCode;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getRowNum() {
        return this.rowNum;
    }

    public void setRowNum(int rowNum) {
        this.rowNum = rowNum;
    }

    public int getColumnNum() {
        return this.columnNum;
    }

    public void setColumnNum(int columnNum) {
        this.columnNum = columnNum;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public boolean getMatch() {
        return this.match;
    }

    public void setMatch(boolean match) {
        this.match = match;
    }

    public String getBoxId() {
        return this.boxId;
    }

    public void setBoxId(String boxId) {
        this.boxId = boxId;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getModifyTime() {
        return this.modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifyBy() {
        return this.modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }

    public String getUserCode() {
        return this.userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }


}
